<template>
    <a-form id="children" :form="form" :wrapper-col="{ span: 5 }" @submit="handleSubmit">
        <a-form-item>
            <a-input v-model="user.username" placeholder="Username">
                <a-icon slot="prefix" type="user" style="color:rgba(0,0,0,.25)"/>
            </a-input>
        </a-form-item>
        <a-form-item>
            <a-input v-model="user.password" type="password" placeholder="Password">
                <a-icon slot="prefix" type="lock" style="color:rgba(0,0,0,.25)" />
            </a-input>
        </a-form-item>
        <a-form-item >
            <a-button style="height: 30px;" type="primary" html-type="submit">
                Login
            </a-button>
        </a-form-item>
    </a-form>
</template>

<script>
    import * as user from '@/services/user/UserService.js'
    export default {
        name:'Login',
        data() {
            return {
                user:{username:'',password:''}
            };
        },
        methods: {
            async handleSubmit(){
                this.$message.success('登陆成功', 3,);
                this.$router.push("Home");
                // let res = await user.login(this.user);
                // if(res === true){
                //     this.$message.success('登陆成功', 3,);
                //     this.$router.push("Home");
                // }

            }

        },
    }
</script>
<style>
    #children {
        margin-left: 45%;
        margin-top:15%;
    }


</style>
